package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author rookie001
 * @creat 2023-04-24-14:29
 */
@Mapper
public interface SetmealDishMapper {
    //根据菜品id查询对应的套餐id
    public List<Long> getSetmealIdsByDishIds(List<Long> ids);
    //插入菜品
    void insertDish(@Param("setmealDishes") List<SetmealDish> setmealDishes);
    //根据id查找
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getDishByid(Long id);
    //删除套餐菜品表数据
    @Delete("delete  from setmeal_dish where setmeal_id= #{id}")
    void deleteByDishId(Long id);

    //根据套餐id查询菜品id
    List<Long> getDishIdsBySetmealIds(List<Long> ids);

}
